package com.eduManage.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.eduManage.beans.Eleve;
import com.eduManage.dao.EleveDAO;

@Service
public class EleveServiceImpl implements EleveService {
	
	private EleveDAO eleveDAO;
	 
    public void setEleveDAO(EleveDAO eleveDAO) {
        this.eleveDAO = eleveDAO;
    }

	@Override
	@Transactional
	public void addEleve(Eleve eleve) {
		// TODO Auto-generated method stub
		
		this.eleveDAO.addEleve(eleve);
		
	}

	@Override
	@Transactional
	public void updateEleve(Eleve eleve) {
		// TODO Auto-generated method stub
		
		this.eleveDAO.updateEleve(eleve);
		
	}

	@Override
	@Transactional
	public List<Eleve> listEleves() {
		// TODO Auto-generated method stub
		return this.eleveDAO.listEleves();
	}

	@Override
	@Transactional
	public Eleve getEleveById(int id) {
		// TODO Auto-generated method stub
		return this.eleveDAO.getEleveById(id);
	}

	@Override
	public void removeEleve(int id) {
		// TODO Auto-generated method stub
		
		this.eleveDAO.removeEleve(id);
		
	}

}
